<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page import="controler.formbeans.AdminBean"%>
<%@include file="parts/Header.jsp" %>
<%--
    Document   : About Us
    Created on : 16/08/2011, 11:47:35 ص
    Author     : Ahmed
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Update News</title>

        <link rel="stylesheet" href="http://code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css" />
        <script src="http://code.jquery.com/jquery-1.8.3.js"></script>
        <script src="http://code.jquery.com/ui/1.9.2/jquery-ui.js"></script>

        <style>
            body { font-size: 62.5%; }
            label, input { display:block; }
            input.text { margin-bottom:12px; width:95%; padding: .4em; }
            fieldset { padding:0; border:0; margin-top:25px; }
            h1 { font-size: 1.2em; margin: .6em 0; }
            div#users-contain { width: auto; margin: 20px 0; }
            div#users-contain table { margin: 1em 0; border-collapse: separate; width: 100%; }
            div#users-contain table td, div#users-contain table th { border: 1px solid #eee; padding: .6em 10px; text-align: left; }
            .ui-dialog .ui-state-error { padding: .3em; }
            .validateTips { border: 1px solid transparent; padding: 0.3em; }
        </style>


    </head>
    <body onload="resizePage()">
        <center>
            <div id="innerPageContainer" >
                <table style="width: 100%" cellpadding="0" cellspacing="0" border="0">
                    <tr>

                        <td rowspan="3" id="innerPageCell" >


                            <html:form action="/admin.do?actionType=UpdateNews" enctype="multipart/form-data">
                                <logic:iterate id="msg" property="news" name="AdminBean">
                                    <div id="users-contain" class="ui-widget">

                                        <table id="users" class="ui-widget ui-widget-content">
                                            <thead>
                                                <tr class="ui-widget-header ">
                                                    <th>News ID</th>
                                                    <th>News Category</th>
                                                    <th>News Title</th>
                                                    <th>News Short Description</th>
                                                    <th>News Description</th>

                                                    <th>ShowHome</th>
                                                    <th>Creation Date</th>

                                                </tr>
                                            </thead>
                                            <tbody>

                                                <tr>
                                                    <html:hidden property="newsId" name="msg"/>
                                                    <td><bean:write name="msg" property="newsId"/></td>
                                                    <td>
                                                        <html:select value="${msg.newsCategories.newsCategoryTitle}" property="newsCategoryId">

                                                            <logic:iterate id="it" name="AdminBean" property="newsCategory">
                                                                <html:option value="${it.newsCategoryId}">${it.newsCategoryTitle}</html:option>

                                                            </logic:iterate>
                                                        </html:select>

                                                    </td>
                                                    <td><html:text value="${msg.newsTitle}" property="newsTitle"/></td>
                                                    <td><html:text value="${msg.newsShortDescription}" property="newsShortDescription"/></td>
                                                    <td><html:text value="${msg.newsDescription}" property="newsDescription"/></td>

                                                    <td>
                                                        <html:select property="showHome" value="${msg.showHome}">
                                                            <html:option value="yes">Yes</html:option>
                                                            <html:option value="no">No</html:option>
                                                        </html:select>
                                                    </td>
                                                    <td><html:text value="${msg.creationDate}" property="creationDate"/></td>

                                                </tr>

                                            </tbody>
                                        </table>
                                    </div>
                                    <table>
                                        <tr> <td> News Logo</td>
                                            <td><html:file property="newsLog"/><html:hidden value="${msg.newsLogo}" property="hiddenNewsLogo"/></td>
                                            <td><img src="${msg.newsLogo}"/></td>
                                        </tr>
                                        <tr> <td>News Image</td>
                                            <td><html:file property="newsImg"/><html:hidden value="${msg.newsImage}" property="hiddenNewsImage"/></td>

                                            <td><img src="${msg.newsImage}"/></td></tr>


                                    </table>           


                                </logic:iterate>
                                <html:submit value="Modify"/>
                            </html:form>

                        </td>
                    </tr>

                    <tr>

                        <td>

                        </td>
                    </tr>

                    <tr>

                    </tr>

                    <tr>
                        <td colspan="2" class="footer">
                            <jsp:include page="parts/Footer.jsp"/>
                        </td>
                    </tr>
                </table>

            </div>





        </center>
    </body>
</html>

